<%@ tag language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@attribute name="name" required="true" rtexprvalue="true"%>
<%@attribute name="type" required="true" rtexprvalue="true" %>
<%@attribute name="placeholder" required="false" rtexprvalue="false" %>
<%@attribute name="required" required="false" rtexprvalue="false" %>
<%@attribute name="enabled" required="false" rtexprvalue="true" %>

<c:set var="content"><c:choose>
<c:when test="${not empty requestScope[name]}"><c:out value="${requestScope[name]}" escapeXml="true"/></c:when>
<c:otherwise><jsp:doBody /></c:otherwise></c:choose></c:set>

<c:choose>
<c:when test="${enabled eq 'false' }">
	<span id="f_${name}">${content}</span>
</c:when>
<c:when test="${type eq 'textarea' }">
	<textarea id="f_${name}" name="${name}">${content}</textarea>
</c:when>
<c:otherwise>
	<input id="f_${name}" name="${name}" type="${type}" value="${content}"/>
</c:otherwise>
</c:choose>